<template>
  <section id="hero">
    <h1 class="tagline">
      <span class="accent">cpu，网卡，硬盘，网关地址，网关mac地址</span>
    </h1>
    <el-input v-model="input"></el-input>
  </section>
</template>
<script>
export default {
  name: "ExampleHelloIndex",
};
</script>
<script setup>
import { ipc } from "@/utils/ipcRenderer";
import { ipcApiRoute } from "@/api";
import { ref, onMounted } from "vue";
// console.log("hello")
const input = ref("");
function clickTest(e) {
  //ipc.send(ipcApiRoute.test2, { a: 1, b: 2 })
  ipc.invoke(ipcApiRoute.test2, "这是一个中文").then(r => {
    // r为返回的数据
    console.log(r);
  })
}
function invokeDll(e) {
  ipc.invoke("controller/example/invokeDll").then(r => {
    // r为返回的数据
    console.log(r);
  })
}
onMounted(() => {
  // 监听，接收 服务端 event.reply()发送的数据
  // ipc.on(ipcApiRoute.test2, (event, result) => {
  //   console.log('[ipcRenderer] [ipcSendMsg] result:', result);
  //   // 调用后端的另一个接口
  //   // event.sender.send(ipcApiRoute.hello, 'electron-egg');
  // })
  ipc.invoke(ipcApiRoute.computer.getNetworkDetails).then(r => {
    console.log(r);
  })
  ipc.invoke(ipcApiRoute.computer.getNetWorkToString).then(r => {
    console.log(r);
  })
})
</script>
<style scoped>
section {
  padding: 42px 32px;
}

#hero {
  padding: 150px 32px;
  text-align: center;
  height: 100%;
}

.tagline {
  font-size: 52px;
  line-height: 1.25;
  font-weight: bold;
  letter-spacing: -1.5px;
  max-width: 960px;
  margin: 0px auto;
}

html:not(.dark) .accent,
.dark .tagline {
  background: -webkit-linear-gradient(315deg, #42d392 25%, #647eff);
  background-clip: text;
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
}

.description {
  max-width: 960px;
  line-height: 1.5;
  color: var(--vt-c-text-2);
  transition: color 0.5s;
  font-size: 22px;
  margin: 24px auto 40px;
}

.actions a {
  font-size: 16px;
  display: inline-block;
  background-color: var(--vt-c-bg-mute);
  padding: 8px 18px;
  font-weight: 500;
  border-radius: 8px;
  transition: background-color 0.5s, color 0.5s;
  text-decoration: none;
}

.actions .setup {
  color: var(--vt-c-text-code);
  background: -webkit-linear-gradient(315deg, #42d392 25%, #647eff);
}

.actions .setup:hover {
  background-color: var(--vt-c-gray-light-4);
  transition-duration: 0.2s;
}
</style>